/**
 * @author Rex Chou
 * @date 2012-07-05
 */
// login.html
function enter() {
	if (event.keyCode == 13)
		loginCheck();
}
function loginCheck() {
	if ($('username').value == "用户名/邮箱/手机号" || $('username').value == "")
		$('userNameError').innerHTML = '<span style="font-size:10px;color:red">账户名不能为空！</span>';
	else
		$('userNameError').innerHTML = '';
	if ($('userpwd').value.length == 0)
		$('userPwdError').innerHTML = '<span style="font-size:10px;color:red">密码不能为空！</span>';
	else
		$('userPwdError').innerHTML = '';
	if ($('userNameError').innerHTML == '' && $('userPwdError').innerHTML == '')
		ThinkAjax.sendForm('login_form', 'login', complete, 'userNameError');
}

//header.html
function quickLoginCheck() {
	var username=document.getElementById('quickUsername');
    if (username.value.length==0) {
       window.alert("用户名不能为空！");
       username.focus();
       return false;
    }
    var password=document.getElementById('quickPwd');
    if (password.value.length==0) {
       window.alert("密码不能为空！");
       password.focus();
       return false;
    }
    return true;
}

function isQuickLogin(data,status) {
	if(status==1) {
		location.reload();
	} else {
		alert(data);
	}
}